import { Card, Form, Input, Button } from "antd";
import './index.scss'
import logo from '@/assets/logo.png'
const Login = () => {
  const onFinish = (values) => {
    console.log(values);
    
  }
  return (
    <div className="login">
      <Card className="login-card">
        <img src={logo} className="logo" alt=""></img>
        <Form validateTrigger={'onBlur'}  onFinish={onFinish}>
          <Form.Item name="mobile"
            rules={[
              {
                required: true,
                message: "请输入手机号",
              },
              {
                pattern: /^1[3-9]\d{9}$/,
                message: "手机号格式不正确",
              },
            ]
            }
          >
            <Input placeholder="请输入手机号" className="login-input" />
          </Form.Item>
          <Form.Item name="code"
            rules={[
              {
                required: true,
                message: "请输入验证码",
              },
              {
                pattern: /^\d{6}$/,
                message: "验证码格式不正确",
              },
            ]
            }
          >
            <Input placeholder="请输入验证码" className="login-input" />
          </Form.Item>
          <Form.Item>
            <Button type="primary" htmlType="submit" className="login-button" classNames="login-button">登录</Button>
          </Form.Item>
        </Form>
      </Card>
    </div>
  )
}

export default Login